using Arcane.Source.Data;
using Godot;

namespace Arcane.Source.Combat
{
    public static class EntityExt
    {
        public static void AddStatusEffect(this Entity entity, int target, bool visible, StringName effectName, StringName triggerName, params Variant[] variants)
        {
            var trigger = GameDB.StatusEffect.Create(triggerName, variants);
            trigger.Show = visible;
            entity.GetTarget(target).AddTrigger(effectName, trigger);
        }

        public static void AddStatusEffect(this Entity entity, int target, StringName effectId, params Variant[] args)
        {
            var effect = GameDB.StatusEffect.Get(effectId);
            entity.GetTarget(target).AddTrigger(effect.TriggerId, GameDB.StatusEffect.Create(effect, args));
        }
    }
}